For convenient reference to stored computer data, the computer data is typically contained in one or more files. Each file has a logical address space for addressing the computer data in the file. Each file also has attributes including an alphanumeric name for identifying the file. In a typical general purpose digital computer or in a file server, an operating system program called a file system manager maps the logical address space of the file to a storage address space of at least one data storage device such as disk drive, and also manages access to attributes of the file. The mapping information and attributes of the file are generally referred to as metadata of the file.
Typically a human user or an application program accesses the computer data in a file by requesting the file system manager to open the file. After the file system manager returns an acknowledgement that the file has been opened, the user or application program sends requests to the file system manager for reading data from or writing data to specified logical addresses of the file.
To request the opening of the file, the user or application program specifies the alphanumeric name for the file. The file system manager searches one or more directories for the specified name of the file. A directory is a special kind of file. The directory includes an alphanumeric name for each file in the directory. The directory also includes a numeric address of the metadata for each file in the directory. Once the file system manager finds the specified name in the directory, it may open the file, and use the numeric address of the metadata associated with the specified name for reading or writing data to the file.
For referencing a large number of files, the files typically are grouped together in a file system including a hierarchy of directories. Each file is specified by a unique alphanumeric pathname through the hierarchy. The pathname includes the name of each directory along a path from the top of the hierarchy down to the directory that includes the file. To open the file, the user or application program specifies the pathname for the file, and the file system manager searches down through the directory hierarchy until finding the metadata of the file.
Because a search for a file may require multiple directories to be scanned along the path through the hierarchy, the search may require considerable time. Therefore, the search is typically performed no more than once each time that a file is opened. In a network environment, when a file server locates a file for a client, the file server returns a file handle that is used by the client for specifically identifying the file in subsequent requests to read data from or write data to the file. The file server may decode the file handle to determine the numeric address of the metadata associated with the file, without another search in a directory of the file system.
In practice, the specific encoding of the file handle depends on the particular network file access protocol used by the client and the file server, and may also depend on the particular version of the software used by the file server. Therefore, the file handle provided by one network file access protocol for access to a file cannot be used by another network file access protocol as the file handle for reading or writing to the same file. Consequently, the conventional procedure for sharing access to a file between two network clients using different file access protocols is for each client to use the pathname for the file in order to obtain a different file handle for reading or writing data to the file.
The sharing of file access between Network File System (NFS) clients and Common Internet File System (CIFS) clients is especially problematic due to the stateless nature of the NFS protocol. If an NFS client has been using the NFS file handle to access data of the file, the file server may not contain state information that would identify the pathname of the file existing when the file handle was issued to the client. Nevertheless, it may be desired to use a CIFS client to access the file given the NFS file handle.
One way of providing a CIFS client with access to a file given the NFS file handle is to access the file system directory and caches of directory name information in the file server to perform a reverse lookup of a file system pathname given the NFS file handle. Unfortunately, such a reverse lookup is laborious and may not result in the correct pathname for the file if the file has been subject to migration and renaming since it was opened by the NFS client. To obtain the correct pathnames for such volatile file handles, a persistent mapping database from file handle to pathname has been maintained in nonvolatile memory or storage. But this approach involves not only the cost of additional nonvolatile memory or storage but also additional processing time whenever a file handle is issued.